/* GUI CONVERTED from rspomtb4.p (converter v1.75) Sat Aug 12 23:14:49 2000 */
/* rspomtb4.p - SHIPPING SCHEDULE/SDT CODE POP-UP WINDOW                */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*V8:ConvertMode=Maintenance                                          */
/*V8:RunMode=Character,Windows                                          */
/* REVISION: 9.0   CREATED       : 11/12/98     BY: *K1QZ* Steve Nugent */
/* REVISION: 9.0  MODIFIED       : 03/13/99     BY: *M0BD* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb              */


/*                                                                          */
/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */
/*                                                                          */
/*         THIS PROGRAM IS A BOLT-ON TO STANDARD PRODUCT MFG/PRO.           */
/* ANY CHANGES TO THIS PROGRAM MUST BE PLACED ON A SEPARATE ECO THAN        */
/* STANDARD PRODUCT CHANGES.  FAILURE TO DO THIS CAUSES THE BOLT-ON CODE TO */
/* BE COMBINED WITH STANDARD PRODUCT AND RESULTS IN PATCH DELIVERY FAILURES.*/
/*                                                                          */
/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */
/*                                                                          */

{mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

 /* ********** Begin Translatable Strings Definitions ********** */
 &SCOPED-DEFINE rspomtb4_p_1 "Generate Ship Schedule From MRP"
 /* Maxlen:   Comment: When this flag is set to "yes", a Supplier
                       Shipping Schedule will be created during
                       the schedule update from MRP */

 &SCOPED-DEFINE rspomtb4_p_2 "SDT Code"
 /* Maxlen:   Comment: This is the Ship Delivery Time Code */

 &SCOPED-DEFINE rspomtb4_p_3 "Shipping Schedule Info"
 /* Maxlen:   Comment: This is the Ship Delivery Time Code */

 /* ********** End Translatable Strings Definitions ********** */

          define   input parameter pod_recid    as recid no-undo.
          define   variable gen_ship            like pod_insp_rqd
                                                     initial true no-undo.
          define   variable time_code           like sdt_code no-undo.

          FORM /*GUI*/ 
            
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
gen_ship   colon 32 label {&rspomtb4_p_1}
            time_code  colon 32 label {&rspomtb4_p_2}
             SKIP(.4)  /*GUI*/
with frame pod3 attr-space overlay side-labels centered row 13
            width 40  NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-pod3-title AS CHARACTER.
 F-pod3-title = (getFrameTitle("SHIPPING_SCHEDULE_INFO",29)).
 RECT-FRAME-LABEL:SCREEN-VALUE in frame pod3 = F-pod3-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame pod3 =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame pod3 + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame pod3 =
  FRAME pod3:HEIGHT-PIXELS - RECT-FRAME:Y in frame pod3 - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME pod3 = FRAME pod3:WIDTH-CHARS - .5. /*GUI*/


            /* SET EXTERNAL LABELS */
            setFrameLabels(frame pod3:handle).

          for first pod_det where recid(pod_det) = pod_recid:
          end.

          assign
             gen_ship   = pod__qad05
             time_code  = pod__qad07
             .

          display
            gen_ship
            time_code
            with frame pod3.

          setloop:
          do on endkey undo, leave:
             set
              gen_ship
              time_code
              with frame pod3.

            if time_code <> "" and
            not(can-find(first sdt_mstr where sdt_code = time_code))
            then do:

               /* NOT A VALID SDT CODE. */
               {mfmsg.i 4372 3}
               next-prompt time_code with frame pod3.
               undo, retry.
            end. /* END OF IF pod__qad07 <> "" */

            assign
              pod__qad05 = gen_ship
              pod__qad07 = time_code
              .

          end. /* setloop */

          hide frame pod3.
